package expression

import "cdam/qiniu/qlang"

type ExpContext interface {
	Predefined
	Var(key string) interface{}
	AddVar(key string, value interface{})
}

type Predefined interface {
	PredefinedVar(key string, value string)

	PredefinedJson(key string, value interface{}) error
}

type Excer interface {
	Predefined

	Exec(ctx ExpContext, exp string) (*OutData, error)

	ScriptImportAlias(model, alias string)

	ScriptImport(model string)

	SetLibs(libs string)
}

func GlobalImport(name string, table map[string]interface{}) {
	qlang.Import(name, table)
}
